home *** CD-ROM | disk | FTP | other *** search
/ Experimental BBS Explossion 3 / Experimental BBS Explossion III.iso / games / nhak_src.zip / INSTALL.DOS < prev    next >
Text File  |  1993-03-16  |  14KB  |  309 lines

  1.     Instructions for compiling and installing NetHack 3.0
  2.            on an MS-DOS, TOS, or OS/2 system
  3.     =====================================================
  4.         (or, How to make PC, ST, and OS/2 NetHack 3.0)
  5.               Last revision: 22 May 1990
  6.  
  7.     Credit for ST and OS/2 NetHack 3.0 goes to Eric Smith and Timo Hakulinen,
  8.     respectively.  Additional credit should be given to Steve Creps and
  9.     Mike Threepoint for PC NetHack.
  10.  
  11. *** Note: if you intend to compile NetHack on an MS-DOS PC using OVERLAY, 
  12.     please turn to the instructions in Install.ovl.  The overlay version is
  13.     currently available only for MSC.
  14.  
  15. 1.  Make sure all the NetHack files are in the appropriate directory structure.
  16.     You should have a main directory with subdirectories src, include, auxil,
  17.     others, amiga, mac, and vms.  If you do not follow this structure, the
  18.     Makefile will not function properly.
  19.  
  20.     All the shared and UNIX-specific .c files and the source Makefile belong
  21.     in src; all the PC .c files and make files belong in others; all the .h
  22.     files belong in include; other assorted files belong in auxil.  We will
  23.     not need any of the files from the amiga, mac, and vms directories.
  24.  
  25.     If you downloaded or ftp'd the sources from a UNIX system, the lines
  26.     will probably end in UNIX-style newlines, instead of the carriage
  27.     return and line feed pairs used by DOS and OS/2.  Turbo C 2.0 in
  28.     particular dislikes these; you'll have to convert them (with a utility
  29.     like Rahul Dhesi's "flip").  Also, every file should end with an empty
  30.     line, because both Microsoft C has a habit of ignoring the last line of
  31.     each file. (TOS compilers generally don't have either problem).
  32.  
  33. 2.  Copy the .c files from the others directory to your src directory
  34.     based on the following decisions.  (You will probably want to include
  35.     all of these files.)
  36.  
  37.     You will definitely need pc*.c and msdos.c.
  38.  
  39.     The file termcap.uu is the fixed version of the Fred Fish termcap library.
  40.     You will need to run a uudecode utility on it to generate the file
  41.     termcap.arc.  termcap.arc contains several files of termcap routines.
  42.     Using them with NetHack involves very little knowledge of the UNIX concept
  43.     of a termcap database; mostly you need to know enough to set a TERM
  44.     environment variable.  You can unarc termcap.arc here in the others
  45.     directory, but if you are going to use it, it is probably best to unarc a
  46.     copy in the src directory.  That way you will not miss copying any
  47.     files over.  Wherever you unarc it, get rid of the included makefile
  48.     since a better version has been provided as Makefile.lib.
  49.  
  50.     random.c is only needed if you want the high-quality random number
  51.     generation routines.
  52.  
  53.     trampoli.c and ovlmgr.obj files are needed for the MS-DOS overlays.
  54.     You may ignore these.
  55.  
  56.     TOS users should use others/lev_lex.c instead of src/lev_lex.c.
  57.     MS-DOS users should be able to use either, but the one in src
  58.     is smaller.  If you have flex or some other lex work-alike, use
  59.     that to produce lev_lex.c from lev_comp.l.
  60.  
  61.     Obviously, TOS users don't need the MS-DOS overlay functions.
  62.     Moreover, the GCC "curses" library has termcap routines built
  63.     in, so if you have this you don't need termcap.arc.
  64.  
  65. 3.  Now look at Makefile.* in your others directory.  Consult the list below
  66.     and pick out the makefile most appropriate to your system.  Rename this
  67.     file to "Makefile" (no extension), and move it into your src directory.
  68.  
  69.     DOS:
  70.     Microsoft C 5.0+    Makefile.msc
  71.     Microsoft C 4.0     Makefile.pc
  72.     Turbo C 2.0        Makefile.tcc
  73.     OS/2:
  74.     Microsoft C 5.1     Makefile.os2
  75.     TOS:
  76.     GCC 1.34        Makefile.st
  77.  
  78.     The PC NetHack makefiles are set up for NDMAKE, a public domain
  79.     "make" utility.  Both Microsoft's and Borland's "make" leave much to
  80.     be desired.  It is worth the extra effort to get NDMAKE if you don't
  81.     already have it.  Among other things, NDMAKE automatically generates
  82.     link response files when the link command involves so many objects
  83.     that the command would become longer than DOS can handle.  If you must
  84.     use Microsoft's or Borland's "make", you'll need to edit the makefile
  85.     into a form your make can use, and add instructions to generate a link
  86.     response file.
  87.  
  88.     Makefile.os2 can also be used with Microsoft NMAKE, which is shipped with
  89.     new versions of MS languages.  This "make", although slightly incompatible
  90.     with NDMAKE, is powerful enough to make NetHack.  Since NDMAKE only works
  91.     in DOS, the only way to compile NetHack in OS/2 currently is to use NMAKE.
  92.     However, when cross-compiling for OS/2 in DOS, NDMAKE is a better choice
  93.     because it requires less RAM for itself.  See Makefile.os2 for more
  94.     information.
  95.  
  96.     The ST NetHack makefile should work with either the widely available
  97.     PD make, or (much better) GNU Make.
  98.  
  99.     If you're using a different compiler, you will have to adapt one of
  100.     the makefiles to your needs.  In particular, change the CC and CFLAGS
  101.     macros to your C compiler's file name and the parameters to pass it.
  102.  
  103.     For DOS users, if you are going to be constructing the Fred Fish termlib
  104.     you will need the Makefile.lib.  Copy this to your source directory too,
  105.     and do not change its name.
  106.  
  107.     Makefile.top in the top directory and Makefile.aux(il) in the
  108.     auxil directory are for UNIX NetHack.  You may delete them.
  109.  
  110. 4.  Now go to the include subdirectory to edit a couple of the header files
  111.     there.
  112.  
  113.     First edit config.h according to the comments to match your system and
  114.     desired set of features.  Mostly you need to check the WIZARD option,
  115.     make sure the HACKDIR is set properly, and check TERMLIB and COMPRESS.
  116.  
  117.     Also edit pcconf.h for PC or OS/2 NetHack, or tosconf.h for ST NetHack.
  118.     pcconf.h should not need much editing.  If you are not going to include
  119.     random.c or termcap.uu you will need to comment out RANDOM or TERMLIB
  120.     respectively.  You will definitely need to comment out OVERLAY.
  121.  
  122.     Commenting out the #define TERMLIB in pcconf.h/tosconf.h to disable
  123.     use of termcap routines (relying on the ANSI_DEFAULT feature) will make
  124.     your job a bit easier.  However, you can compile with both and simply
  125.     not set your TERM variable if you do not wish to use the termcap file
  126.     settings.
  127.  
  128.     ST and OS/2 NetHackers can skip to the next section, since the entire game
  129.     will fit in less than one megabyte.
  130.  
  131.  PC NetHackers:
  132.  
  133.     To compile under MS-DOS, you must either produce an overlaid executable or
  134.     make some very difficult decisions about which features to include.
  135.  
  136.     The base size of a PC NetHack executable, with no extra features or
  137.     overlays, will be around 570 (or better) kilobytes.  Anything over 590K
  138.     is likely not to work.  Here's an incomplete and outdated list of the
  139.     approximate costs of various additional features in terms of executable
  140.     size, using Microsoft C:
  141.  
  142.     WIZARD            3K
  143.     LOGFILE
  144.     NEWS
  145.     COMPRESS        2K
  146.     ZEROCOMP
  147.     CHDIR
  148.  
  149.     POLYSELF       31K
  150.     THEOLOGY       11K
  151.     SOUNDS            6K
  152.     KICK
  153.  
  154.     THRONES         3K
  155.     FOUNTAINS        2K
  156.     SINKS            5K
  157.     ALTARS            4K
  158.  
  159.     WALLIFIED_MAZE        1K
  160.     REINCARNATION        7K
  161.     STRONGHOLD       13K
  162.  
  163.     ORACLE
  164.     MEDUSA
  165.     KOPS
  166.     ARMY            1K
  167.     WORM
  168.     GOLEMS            2K
  169.     INFERNO
  170.     SEDUCE
  171.     TOLKIEN
  172.     PROBING         1K
  173.     WALKIES         4K
  174.     SHIRT
  175.     MUSIC            6K
  176.     TUTTI_FRUTTI
  177.     SPELLS           10K
  178.     NAMED_ITEMS
  179.  
  180.     ELBERETH        3K
  181.     EXPLORE_MODE        2K
  182.     HARD
  183.  
  184.     REDO            1K
  185.     COM_COMPL        1K
  186.     CLIPPING
  187.  
  188.     DGK            7K
  189.     TERMLIB
  190.     RANDOM            1K
  191.     SHELL
  192.     TEXTCOLOR        1K
  193.  
  194.     Using Turbo C, we eked by with just WIZARD, ZEROCOMP, BITFIELDS, ELBERETH,
  195.     HARD, REDO, DGK and TEXTCOLOR.
  196.  
  197. 5.  If you're using a compiler not in the list in step 3, you may want to look
  198.     through system.h, in the include directory.  This file matches the return
  199.     and parameter types for system calls and library routines with various
  200.     flavors of compilers and operating systems.  Leaving this file alone is
  201.     unlikely to cause problems, but if you get compile errors with any
  202.     functions in the standard library, it's worth checking the declarations
  203.     there.
  204.  
  205. 6.  If you want to change the high score list behavior, examine the top of
  206.     topten.c, in the src directory.  You may want to change the definitions of
  207.     PERSMAX, POINTSMIN, and ENTRYMAX.  I set POINTSMIN to 51 and ENTRYMAX to
  208.     50 to keep the size of the score list down.
  209.  
  210. 7.  Go to the src directory and edit the top of your Makefile.  Be sure the
  211.     directory you want the game installed in actually exists.
  212.  
  213.     If you elected not to use the high-quality BSD random number routines by
  214.     commenting out RANDOM in pcconf.h or tosconf.h, comment out (or set equal
  215.     to nothing) the RANDOM macro in your Makefile.
  216.  
  217.     If you elected to use Fred Fish's termcap library (bundled in as
  218.     termcap.arc), you will have to generate termcap.lib from those sources
  219.     by typing make -f makefile.lib termlib.lib.  DOS / OS/2 users must set the
  220.     TERMLIB option in Makefile.msc / Makefile.os2 to link in the resulting
  221.     termlib.lib.
  222.  
  223.     If you are recompiling after patching your sources, or if you got your
  224.     files from somewhere other than the official distribution, "touch
  225.     makedefs.c" to ensure that certain files (onames.h and pm.h) are remade,
  226.     lest potentially troublesome timestamps fool "make".
  227.  
  228. 8.  Now, enter "make all", and take a long siesta; your computer will be
  229.     occupied for a long time.  If all goes well, you will get an executable.
  230.     If you tried to compile in too many features, you will probably get a
  231.     dysfunctional executable, and will have to start over.
  232.  
  233.     Hint:  If you're short on memory, you might enter "make -n all
  234.     >script.bat", and then in DOS enter "script", or in TOS use the Gulam
  235.     command "source script.bat".  GCC users will be short on memory if
  236.     they only have 2 megabytes. Indeed, some files will not compile in
  237.     2 megabytes with the GCC 1.36; for these you'll either have to turn
  238.     off the -O option or use an earlier version of the GCC.
  239.  
  240. 9.  Make sure the support files-- data, rumors, cmdhelp, opthelp, help, hh,
  241.     history, license, and oracles (if ORACLES was #define'd)-- were copied
  242.     to the game directory.  If not, move them there from the auxil directory
  243.     yourself.  rumors can be created manually by entering "makedefs -r";
  244.     data by entering "makedefs -d".
  245.  
  246.     If you compiled in the compiled levels (if STRONGHOLD was #define'd), make
  247.     sure castle, tower?, and possibly endgame are there, too.  They can be
  248.     created manually by entering "lev_comp filename.des", where filename.des
  249.     is the appropriate description file (found in the auxil directory).
  250.  
  251. 10. Go to the others directory.  Copy NetHack.cnf, or Atari.cnf for TOS, to
  252.     your game directory as "NetHack.cnf".  Edit it to reflect your particular
  253.     setup and personal preferences, following the comments.
  254.  
  255.     If you compiled in the TERMLIB feature, also move the "termcap" file to
  256.     your game directory.  (Note:  GCC's termcap routines have built-in
  257.     defaults, so the termcap file is not necessary with that compiler.)
  258.  
  259.     To use funky graphics charaters in TOS, uudecode "atarifnt.uue" and unarc
  260.     the resulting "atarifnt.arc".  This contains a program to run that makes
  261.     some line graphics characters available to NetHack.  To use them, uncomment
  262.     the appropriate line in your NetHack.cnf file, and run the program before
  263.     running NetHack (you can put the program in an AUTO folder if you want).
  264.  
  265.     If you'll be running NetHack from a different subdirectory, you will
  266.     want to "set HACKDIR=\games\nethack" (or whatever directory you want to
  267.     use) now.  Add it to your autoexec.bat (in DOS), if you'll be playing
  268.     often.
  269.  
  270. 11. Play NetHack.  If it works, you're done!
  271.  
  272.  
  273. Notes
  274. -----
  275.  
  276. 1)  Save files and bones files from previous versions will not work with
  277.     NetHack 3.0.  Don't bother trying to keep them.  Record (score) files
  278.     from before 3.0 patchlevel 7 will almost work, but you need to make one
  279.     change manually to them:  At the end of each line is a word or phrase
  280.     specifying what killed the player.  Change the string to start with the
  281.     words "killed by", "killed by a", or "killed by an" (whichever is
  282.     appropriate).  If the death was petrification, it should read "petrified
  283.     by" instead of "killed by".  Don't change "starvation", "quit", "escaped",
  284.     or "ascended".
  285.  
  286. 2)  To install an update of NetHack after changing something, enter "make"
  287.     from the src directory.  If you add, delete, or reorder monsters or
  288.     objects, or you change the format of saved level files, delete any save
  289.     and bones files.  (Trying to use such files sometimes produces amusing
  290.     confusions on the game's part, but usually crashes.)
  291.  
  292. 3)  During linking, the Microsoft Overlay Linker will need temporary storage
  293.     space to make the PC and OS/2 versions.  Make sure you have
  294.     about a meg of free disk where ever you have defined your temporary
  295.     storage.  It is also a good idea to compile with as much free RAM as
  296.     possible.  It may otherwise get crowded with the bigger, more complex
  297.     source files.  (Compiler bombs with "out of heap space" or similar.)
  298.     If this happens, strip your configuration, zap TSR's etc.
  299.  
  300. 4)  On a 286 10MHz PC you will have NetHack in about 2 - 2.5 hours.
  301.  
  302. 5)  Both OS/2 NetHack and the overlaid PC NetHack have been developed using
  303.     MSC 5.1.  MSC 6.0 is on the market, but since there hasn't been enough
  304.     time to fully test the game compiled with MSC 6.0, the distribution version
  305.     supports officially only MSC 5.1.  To compile NetHack with MSC 6.0, it may
  306.     be necessary to make some slight modifications to respective makefiles
  307.     as well as some source files.  Also, when compiling OS/2 version with MSC
  308.     6.0, change library "doscalls" to "os2" in Makefile.os2.
  309.